//
//  PlaceActivity.m
//  SportSocial
//
//  Created by yull on 15/3/16.
//  Copyright (c) 2015年 yull. All rights reserved.
//

#import "PlaceActivity.h"

@implementation PlaceActivity

+ (instancetype)placeActivityWithDict:(NSDictionary *)dict
{
    PlaceActivity *placeActivity = [[PlaceActivity alloc] init];
    for (NSString *key in dict.allKeys) {
        id value = [dict objectForKey:key];
        if ([value isKindOfClass:[NSNull class]]) {
            value = @"";
        }
        
        [placeActivity setValue:value forKey:key];
    }
    return placeActivity;
}

- (void)setValue:(id)value forUndefinedKey:(NSString *)key
{
    if ([key isEqualToString:@"id"]) {
        [self setValue:value forKey:@"activity_id"];
    }else {
        [super setValue:value forUndefinedKey:key];
    }
}

@end
